import React, {useState, useEffect} from 'react';

function ProfilePage() {
  
  const [time, changeTime] = useState('')

  useEffect(() => {
    setInterval(() => {
      // 获取当前系统时间
      const currentTime = new Date( +new Date() + 8 * 3600 * 1000 ).toJSON().slice(0,19).replace("T"," ")
      // 将系统时间赋值给state
      changeTime(currentTime)
    },1000)
  },[])

  return (
    <div>{time}</div>
  );
}

export default ProfilePage;
